﻿using System;

namespace MyClock
{
    internal class Program
    {
        static void Main(string[] args)
        {
            Clock clock = new Clock();
            clock.Time = new DateTime(2008, 4, 5, 11, 12, 13);
            clock.RingTime = new DateTime(2008, 4, 5, 11, 12, 20);
            clock.IsRingOpen = true;
            clock.TickTok();
            clock.OnRinging += Clock_OnRinging;
            while (true)
            {
                if (Console.ReadKey().Key == ConsoleKey.Q)
                {
                    clock.Switch(false);
                }
            }
        }

        private static void Clock_OnRinging(Clock clock)
        {
            clock.Dispose();
        }
    }
}
